package com.xy.bizport.data;

import android.os.Parcel;
import android.os.Parcelable;

public class MyThrowable extends Throwable implements Parcelable {
    private static final long serialVersionUID = 1L;

    public MyThrowable(Throwable t) {
        super(t);
    }
    
    public MyThrowable(Parcel parcel) {
        super((Throwable)parcel.readSerializable());
        setStackTrace((StackTraceElement[])parcel.readSerializable());
    }
    
    public static final Creator<MyThrowable> CREATOR = new Creator<MyThrowable>() {
        public MyThrowable createFromParcel(Parcel in) {
            return new MyThrowable(in);
        }

        public MyThrowable[] newArray(int size) {
            return new MyThrowable[size];
        }
    };

    @Override
    public int describeContents() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeSerializable(this);
        dest.writeSerializable(getStackTrace());
    }
}
